<script src = "fetch-test-options.js"></script>
<script src = "thorough-util.js"></script>
<script>
function onMessage(event) {
  var script = document.createElement('script');
  script.src = event.data.url;
  script.addEventListener(
    'error',
    function() { report({jsonpResult:'error'}); });
  document.body.appendChild(script);
}
function report(data) {
  window.parent.postMessage(
    data,
    document.location.origin);
}
function onload() {
  window.addEventListener('message', onMessage, false);
}
window.addEventListener('load', onload);
</script>
